﻿using LitS3;

namespace BrandonHaynes.Providers.AmazonS3
	{
	/// <summary>
	/// A helper class representing a bucket and S3-object pair
	/// </summary>
	class BucketObjectPair
		{
		public Bucket Bucket { get; private set; }
		public ObjectEntry ObjectEntry { get; private set; }

		public BucketObjectPair(Bucket bucket, ObjectEntry objectEntry)
			{
			Bucket = bucket;
			ObjectEntry = objectEntry;
			}

		/// <summary>
		/// Converts the underlying S3 object to its S3File form (given a portalId context)
		/// </summary>
		public S3File ToS3File(int portalId)
			{ return ObjectEntry.ToS3File(portalId, Bucket.Name); }
		}
	}
